/**
 * 用户相关接口
 */

import http from "@/utils/request"

/**
 * 登录
 * @param {*} data 
 * @returns 
 */
export const loginAPI = (data) => {
  return http({
    url: "/sys/login",
    method: "post",
    data
  })
}

/**
 * 获取用户信息
 * @returns 
 */
export const userInfoAPI = () => {
  return http({
    url: "/sys/profile"
  })
}

/**
 * 修改密码
 * @param {*} param0 
 * @returns 
 */
export const UPpasswdAPI = ({ oldPassword, newPassword }) => {
  return http({
    url: "/sys/user/updatePass",
    method: "put",
    data: {
      oldPassword,
      newPassword
    }
  })
}